﻿package sedie 
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import game.exchangeddata.HashTable;
	import game.exchangeddata.TableInfo;
	import common.Utility;
	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)	
	 */
	public class TableInfoPanel extends MovieClip
	{
		public var txtTableNameTf:TextField;
		public var txtTableInfoTf:TextField;
		
		public var tableNameTf:TextField;
		public var tableInfoTf:TextField;
		
		public var minBetZeroTf:TextField;
		public var maxBetZeroTf:TextField;
		public var minBetOneTf:TextField;
		public var maxBetOneTf:TextField;
		public var minBetThreeTf:TextField;
		public var maxBetThreeTf:TextField;
		public var minBetFourTf:TextField;
		public var maxBetFourTf:TextField;
		
		public var dateTf:TextField;
		public var clockTf:TextField;
		
		public function TableInfoPanel() 
		{
			init();
		}
		
		private function init():void {
			
			txtTableNameTf.mouseEnabled = false;
			txtTableInfoTf.mouseEnabled = false;
			
			tableNameTf.mouseEnabled = false;
			tableInfoTf.mouseEnabled = false;
			
			minBetZeroTf.mouseEnabled = false;
			maxBetZeroTf.mouseEnabled = false;
			minBetOneTf.mouseEnabled = false;
			maxBetOneTf.mouseEnabled = false;
			minBetThreeTf.mouseEnabled = false;
			maxBetThreeTf.mouseEnabled = false;
			minBetFourTf.mouseEnabled = false;
			maxBetFourTf.mouseEnabled = false;
			
			dateTf.mouseEnabled = false;
			clockTf.mouseEnabled = false;
		}
		
		public function updateTableInfo(tableinfo:TableInfo):void {
			this.tableNameTf.text = tableinfo.tableName;
			this.tableInfoTf.text = tableinfo.gameSet + " - " + tableinfo.gameNo;
		}	
		
		public function updateDateClock(tableinfo:TableInfo):void {
			this.dateTf.text = tableinfo.dateGame;
			this.clockTf.text = tableinfo.clockGame;
		}	
		
		public function updateTableMinMax(minBet:Number, maxBet:Number):void {
			
			trace("minBet:" + minBet +"maxBet" +  maxBet);
			minBetZeroTf.text = minBet + "";
			maxBetZeroTf.text = maxBet + "";
			minBetOneTf.text = minBet + "";
			maxBetOneTf.text = maxBet + "";
			minBetThreeTf.text = minBet + "";
			maxBetThreeTf.text = maxBet + "";
			minBetFourTf.text = minBet + "";
			maxBetFourTf.text = maxBet + "";
			
		}		
		
		public function initText(hashTableInfo:HashTable):void {
			this.txtTableNameTf.text = hashTableInfo.lookupString("INFOtable");
			this.txtTableInfoTf.text = hashTableInfo.lookupString("INFOgame");
			/*this.txtMinBetTf.text = hashTableInfo.lookupString("INFOMinbet");
			this.txtMaxBetTf.text = hashTableInfo.lookupString("INFOMaxbet");*/
		}
		
		
	}

}